- page_title _('User map'), _('FogBugz import')
- header_title _("New project"), new_project_path
- add_to_breadcrumbs s_('ProjectsNew|Import project'), new_project_path(anchor: 'import_project')

%h1.page-title.gl-font-size-h-display.d-flex
  .gl-display-flex.gl-align-items-center.gl-justify-content-center
    = sprite_icon('bug', css_class: 'gl-mr-2')
  = _('Import projects from FogBugz')
%hr

= form_tag create_user_map_import_fogbugz_path(namespace_id: params[:namespace_id]) do
  %p
    = _("Customize how FogBugz email addresses and usernames are imported into GitLab. In the next step, you'll be able to select the projects you want to import.")
  %p
    = _("The user map is a mapping of the FogBugz users that participated on your projects to the way their email address and usernames will be imported into GitLab. You can change this by populating the table below.")
  %ul
    %li
      %strong= _("Default: Map a FogBugz account ID to a full name")
      %p
        = _("An empty GitLab User field will add the FogBugz user's full name (e.g. \"By John Smith\") in the description of all issues and comments. It will also associate and/or assign these issues and comments with the project creator.")
    %li
      %strong= _("Map a FogBugz account ID to a GitLab user")
      %p
        = html_escape(_('Selecting a GitLab user will add a link to the GitLab user in the descriptions of issues and comments (e.g. "By %{link_open}@johnsmith%{link_close}"). It will also associate and/or assign these issues and comments with the selected user.')) % { link_open: '<a href="#">'.html_safe, link_close: '</a>'.html_safe }

  %table.table
    %thead
      %tr
        %th= _("ID")
        %th= _("Name")
        %th= _("Email")
        %th= _("GitLab User")
    %tbody
      - @user_map.each do |id, user|
        %tr
          %td= id
          %td= text_field_tag "users[#{id}][name]", user[:name], class: 'form-control gl-form-input'
          %td= text_field_tag "users[#{id}][email]", user[:email], class: 'form-control gl-form-input'
          %td
            .js-gitlab-user{ data: { name: "users[#{id}][gitlab_user]" } }

  .form-actions
    = render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm) do
      = _('Continue to the next step')
